// 库引入
import React, {Component} from 'react';
import {inject, observer} from 'mobx-react';
import classNames from 'classnames';

// 样式引入
import styles from './style.module.less';

@observer
class Caption extends Component {
  render() {
    return (
      <div className={classNames(styles.caption, this.props.className)} style={this.props.style}>
        <h1 className={styles.title}>{this.props.title}</h1>
        <p className={styles.subTitle}>{this.props.subTitle}</p>
      </div>
    );
  }
}

Caption.defaultProps = {
  title: 'BootCDN',
  subTitle: '稳定、快速、免费的前端开源项目 CDN 加速服务'
};

const InjectCaption = inject(({someStore={}}) => ({someProps: someStore.attribute}))(Caption);

export {
  Caption,
  InjectCaption
};